# -*- coding: utf-8 -*-
import base64

"""
加密工具类
"""


class EncryptTools:
    @staticmethod
    def base64_encode(text):
        """
        base64加密方法
        :return:
        """
        encoded_bytes = base64.b64encode(text.encode('utf-8'))
        short_code = encoded_bytes.decode('utf-8')
        return short_code
    
    @staticmethod
    def base64_decode(text):
        """
        base64解密方法
        :param text:
        :return:
        """
        encoded_bytes = text.encode('utf-8')
        decoded_bytes = base64.b64decode(encoded_bytes)
        decoded_text = decoded_bytes.decode('utf-8')
        return decoded_text


if __name__ == '__main__':
    text = '1111111111111'
    print(EncryptTools.base64_encode(text))




